﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class doctor_paper : System.Web.UI.Page
{
    protected Doctor doc;
    protected int guid;
    public Student stu;
    protected void Page_Load(object sender, EventArgs e)
    {
        doc = Doctor.Check();
        if (doc == null)
        {
            Session.Add(Params.SystemError, "请先登录");
            Response.Redirect(Params.RootHttp + "default.aspx");
        }
        this.guid = Convert.ToInt32(Request.Params["guid"]);
        stu = new Student(guid);
        this.conNav.Title = "审阅论文";
        if (!Doctor.ExpertHasStudent(this.doc.Guid, guid))
        {
            Session.Add(Params.SystemError, "发生错误");
            Response.Redirect(Params.DoctorFolderHttp + "students.aspx?uid=" + Server.UrlEncode(this.doc.UserID));
        }
        if (!Page.IsPostBack)
        {
            this.MyDataBind();
        }
    }

    public void MyDataBind()
    {
        this.Title = this.doc.RealName + "-评审论文-" + this.stu.PaperName;
        this.conNav.Title = "评审论文";
        string sql = "select Guid from Paper where StudentGuid=" + this.guid.ToString() + " order by Guid asc";
        DataTable dt = Fun.CreateDt(sql);
        this.repPapers.DataSource = dt;
        this.repPapers.DataBind();
    }
    protected void btnWrite_Click(object sender, EventArgs e)
    {
        Response.Redirect("write.aspx?uid=" + Request.Params["uid"] + "&recvers=" + this.stu.Guid.ToString());
    }
}
